<template>
  <section>
    <el-form-item label="维表类型" required>
       <el-select v-model="value.type" placeholder="请选择">
          <el-option label="SQL" value="sql"></el-option>
          <el-option label="日期范围" value="range_date"></el-option>
          <!-- <el-option label="月份范围" value="range_month"></el-option>
          <el-option label="年份范围" value="range_year"></el-option> -->
        </el-select>
    </el-form-item>
    <el-form-item label="维表视图SQL" required v-if="value.type=='sql'">
      <el-input type="textarea" v-model="value.sql" placeholder="请输入" />
    </el-form-item>
    <el-form-item label="日期范围(天数范围)" required v-if="value.type=='range_date'">
      <el-input-number v-model="value.range_date_begin" controls-position="right" @change="handleChange" :min="1" :max="999"></el-input-number>
        -
      <el-input-number v-model="value.range_date_end" controls-position="right" @change="handleChange" :min="1" :max="999"></el-input-number>
    </el-form-item>
    <el-form-item label="月份范围(天数范围)" required v-if="value.type=='range_month'">
      <el-input-number v-model="value.range_month_begin" controls-position="right" @change="handleChange" :min="1" :max="999"></el-input-number>
        -
      <el-input-number v-model="value.range_month_end" controls-position="right" @change="handleChange" :min="1" :max="999"></el-input-number>
    </el-form-item>
    <el-form-item label="年份范围(天数范围)" required v-if="value.type=='range_year'">
      <el-input-number v-model="value.range_year_begin" controls-position="right" @change="handleChange" :min="1" :max="999"></el-input-number>
        -
      <el-input-number v-model="value.range_year_end" controls-position="right" @change="handleChange" :min="1" :max="999"></el-input-number>
    </el-form-item>
    <el-form-item label="隐藏没有值的维度" required>
      <el-switch v-model="value.hiddenZeroLabel" active-color="#13ce66" inactive-color="#ff4949">
      </el-switch>
    </el-form-item>
  </section>
</template>

<script>
  export default {
    props: {
      value: {
        type: Object,
        default: null
      },
    },
    data() {
      return {
        sp: {},
        sr: {},
        param: {}
      }
    },
    created(options) {
      let that = this;
      that.xinit();
    },
    methods: {
      xinit() {
        let that = this;
      },
    }
  }
</script>

<style>

</style>
